﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpSatPlan.LexerParser
{
    public class DomainProcessor
    {
        string mDomainFileName;

        public DomainProcessor(string domFileName)
        {
            this.mDomainFileName = domFileName;
        }

        public Domain BuildDomain()
        {
            Domain domain;
            PddlLexer lexer;
            DomainParser domainParser;
            TUVienna.CS_CUP.Runtime.Symbol root;

            // build domain
            lexer = new PddlLexer(new System.IO.StreamReader(this.mDomainFileName));
            domainParser = new DomainParser(lexer);
            root = domainParser.parse();
            domain = ((DomainNode)root.value).BuildDomain();
            return domain;
        }
    }
}
